<?php $this->load->view('admin_home/_header') ?>
<?php $this->load->view('message') ?>

<script type="text/javascript">
  $().ready(function(){
    $("#test_point_li").addClass("active");

	
 
});
  function delete_knowledge_point(id)
	{
		if(confirm("删除后不可恢复，确定吗？"))
			location.href="<?php echo site_url('admin_knowledge_point/delete').'/'?>"+id;
	}
</script>


<div class="container">
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title">查看考点</h3>
		</div>
		<div class="panel-body">
				<fieldset>
					<div class="form-group">
						<label class="col-lg-2 control-label">考点内容:</label>
						<div class="col-lg-10">
							<p><?=$test_point['content']?></p>
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-2 control-label">相关模块:</label>
						<div class="col-lg-10">
							<?php if (!$relative_modules): ?>
								<p>无</p>
							<?php endif ?>
							<?php foreach ($relative_modules as $item ): ?>
								<p class="text-primary"><?=$item['name']?></p>	
							<?php endforeach ?>
							
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-2 control-label">相关知识点:</label>
						<div class="col-lg-10">
							<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
								<?php $index=1; ?>
								<?php foreach ($relative_knowledge_points as $item): ?>
									<div class="panel panel-default">
									    <div class="panel-heading" role="tab" id="heading<?=$index?>">
									      <h4 class="panel-title">
									        <a data-toggle="collapse" data-parent="#accordion" href="#collapse<?=$index?>" aria-expanded="true" aria-controls="collapse<?=$index?>">
									         	<?php echo $item['content'] ?>
									        </a>
									      </h4>
									    </div>
									    <div id="collapse<?=$index?>" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading<?=$index?>">
									      <div class="panel-body">
									        	<?php if ($item['explanation']): ?>
									        		<p><?php echo $item['explanation'] ?></p>	
									        	<?php endif ?>
									        	<?php if ($item['picture']): ?>
									        		<p><img src="<?php echo base_url() ?>/uploads/exp/<?=$item['id']?>/pic.jpg?'?><?php echo rand()?>"></p>	
									        	<?php endif ?>

								        		<a class="btn btn-primary" href="<?php echo site_url('admin_knowledge_point/edit').'/'.$item['id']?>">编辑</a>
								        		<a class="btn btn-primary" onclick="delete_knowledge_point(<?=$item['id']?>)" href="#">删除</a>
									      </div>
									    </div>
								  	</div>
								<?php $index++; ?>
								<?php endforeach ?>
							</div>  
							
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-2 control-label"></label>
						<div class="col-lg-10">
							<a class="btn btn-primary" href="<?php echo site_url('admin_knowledge_point/add').'/'.$test_point['id']?>" class="btn btn-primary ">添加知识点</a>
							<a class="btn btn-primary" href="<?php echo site_url('admin_test_point/edit').'/'.$test_point['id'] ?>">编辑考点</a>
							<a class="btn btn-primary" href="<?php echo site_url('admin_test_point/index') ?>">返回</a>
						</div>
					</div>
				</fieldset>

		</div>
	</div>
</div>

<?php $this->load->view('admin_home/_footer')?>